class CreatePeerPrices < ActiveRecord::Migration
  def self.up
    create_table :peer_prices do |t|
      t.string :type_name,
        :name,
        :model_no
      t.integer :enterprise_id,
        :cpu_id,
        :memory_id,
        :hard_disk_id
      t.decimal :peer_price, :precision => 8, :scale => 2, :default => 0
      t.decimal :trade_price, :precision => 8, :scale => 2, :default => 0
      t.decimal :retail_price, :precision => 8, :scale => 2, :default => 0
      t.date :released_on
      t.string :type
      t.string :stock_situation, :default => 'full'
      t.string :status, :default => 'released'
      t.timestamps
    end
  end

  def self.down
    drop_table :peer_prices
  end
end
